package com.tianhui.consignortwofei.role;

import android.text.TextUtils;

import com.fgs.common.utils.ToastUtil;
import com.tianhui.consignortwofei.R;
import com.tianhui.consignortwofei.mvp.model.enty.ProfileInfo;
import com.tianhui.consignortwofei.utils.ApplicationUtil;

/**
 * @author fgs
 * @date 2021/6/18
 * @description 平台用户
 **/
public class PlatformRole extends BaseRole {

    private final ProfileInfo profileInfo;

    public PlatformRole(ProfileInfo profile) {
        this.profileInfo = profile;
    }

    @Override
    public void deliverGoodsOperate() {
        boolean isAuditPass = !TextUtils.isEmpty(profileInfo.roleinfoisaudit) && profileInfo.roleinfoisaudit.equals("1");
        if (isAuditPass) {
            super.deliverGoodsOperate();
        } else {
            ToastUtil.showShortToast(ApplicationUtil.getContext().getString(R.string.tip_can_not_delver_goods));
        }
    }

    @Override
    public boolean isShowOrderTypeTabLayout() {
        return true;
    }


    @Override
    public boolean isShowPerfectData() {
        return true;
    }

    @Override
    public boolean isShowSalesMan() {
        boolean result = profileInfo != null && !TextUtils.isEmpty(profileInfo.roleinfotype) && profileInfo.roleinfotype.equals("01");
        return result;
    }

    @Override
    public boolean isShowBelongArea() {
        boolean result = profileInfo != null && !TextUtils.isEmpty(profileInfo.roleinfotype) && profileInfo.roleinfotype.equals("01");
        return result;
    }
}
